﻿using DeltaGroup.WheelOfJeopardy.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace DeltaGroup.WoJ.Tests.WheelTests
{
    /// <summary>
    ///This is a test class for SectorFectoryTest and is intended
    ///to contain all SectorFectoryTest Unit Tests
    ///</summary>
    [TestClass]
    public class SectorFactoryTest
    {
        #region Fields

        private TestContext testContextInstance;

        #endregion Fields

        #region Properties

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #endregion Properties

        #region Methods

        /// <summary>
        ///A test for CreateSector
        ///</summary>
        [TestMethod]
        public void CreateSectorTest_BankruptSector()
        {
            string typeName = "DeltaGroup.WheelOfJeopardy.Model.BankruptSector"; // TODO: Initialize to an appropriate value
            Type expected = new BankruptSector().GetType();
            Sector actual;
            actual = SectorFactory.CreateSector(typeName);
            Assert.IsInstanceOfType(actual, expected);
        }

        /// <summary>
        ///A test for CreateSector
        ///</summary>
        [TestMethod]
        public void CreateSectorTest_CatA()
        {
            string typeName = "DeltaGroup.WheelOfJeopardy.Model.CategorySector"; // TODO: Initialize to an appropriate value
            Sector expected = new CategorySector("CS History");
            Sector actual;
            actual = SectorFactory.CreateSector(typeName, "CS History");
            Assert.AreEqual(expected.Caption, actual.Caption);
            Assert.IsInstanceOfType(actual, expected.GetType());
        }

        [TestMethod]
        public void CreateSectorTest_LoseTurnSector()
        {
            string typeName = "DeltaGroup.WheelOfJeopardy.Model.LoseTurnSector"; // TODO: Initialize to an appropriate value
            Type expected = new LoseTurnSector().GetType();
            Sector actual;
            actual = SectorFactory.CreateSector(typeName);
            Assert.IsInstanceOfType(actual, expected);
        }

        #endregion Methods

        /// <summary>
        ///A test for CreateSector
        ///</summary>
        [TestMethod()]
        public void CreateSectorTest()
        {
            string typeName = typeof(CategorySector).ToString();
            string category = "Cat A";
            Type expected = new CategorySector(category).GetType();
            Sector actual;
            actual = SectorFactory.CreateSector(typeName, category);
            Assert.IsInstanceOfType(actual, expected);
        }

        /// <summary>
        ///A test for CreateSector
        ///</summary>
        [TestMethod()]
        public void CreateSectorTest1()
        {
            string typeName = typeof(BankruptSector).ToString();
            Type expected = typeof(BankruptSector);
            Sector actual;
            actual = SectorFactory.CreateSector(typeName);
            Assert.IsInstanceOfType(actual, expected);
        }
    }
}